-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output labels when disassembling code #8897
Conversation
👍 |
} | ||
const char *SymbolTable::lookupSymbol(uint64_t addr) | ||
{ | ||
std::cout << "lookupSymbol(" << addr << ")\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, that's just leftover debug output. Since the actual disassembled output is cached, cout output appears above, making it easy to miss.
would this allow us to also start generating better labels for call instructions and variable assignments? or is this just for labels (which is alone very awesome)? |
This is at the moment only for branch labels, where the new code maintains a symbol table. If Julia already has a symbol table (I guess it does) for call targets, then it should be just a few additional lines to convert those into meaningful names as well. Any pointers? (What's up with Travis? I always get gfortran errors for the OS X tests, and I don't think it's related to my changes.) |
The labels are still output with the wrong offset (as if they had the value 0), and debug info is enabled.
Call labels are now resolved as well. |
Wow, this is impressive. Can you show some example output? |
Example output with labels. Local (branch) labels use
|
It seems the code is missing some symbols. I think this may be related to functions that have not yet been compiled, and where the code presumably is pointing to a wrapper or trampoline. Where is the data structure defined in Julia that holds the mapping between functions and addresses? I found |
Nice. This makes the native code dumps actually somewhat decipherable when there are branches. |
Conflicts: src/disasm.cpp
Output labels when disassembling code
This addresses #6589.
This handles only the LLVM33 non-MCJIT case. Addressing the other cases seems straightforward, but I currently can't test them locally.